package com.ytjj.qmyx.admin.service.impl;

import com.ytjj.qmyx.admin.model.PayStatistics;
import com.ytjj.qmyx.admin.model.request.PayStatisticsRequest;
import com.ytjj.qmyx.admin.model.response.PaySummary;
import com.ytjj.qmyx.admin.service.StatisticsService;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @Description TODO
 * @ClassName StatisticsServiceImpl
 *
 * 
 * @Version 1.0
 **/

@Service
public class StatisticsServiceImpl implements StatisticsService {

    @Override
    public List<PayStatistics> getPayStatisticsList(PayStatisticsRequest payStatisticsRequest) {
        String sTime = payStatisticsRequest.getDayTime() + " 00:00:00";
        String eTime = payStatisticsRequest.getDayTime() + " 23:59:59";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            Date startTime = sdf.parse(sTime);
            Date endTime = sdf.parse(eTime);
            payStatisticsRequest.setStartTime(startTime);
            payStatisticsRequest.setEndTime(endTime);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public PaySummary getPaySummary(PayStatisticsRequest payStatisticsRequest) {
        return null;
    }

}
